import { LayoutIndex } from "@/routers/constant";
import { RouteObject } from "@/routers/interface";
import ReactComponent from "@/views/reactCom/reactComponent/index";
import PropsData from "@/views/reactCom/propsData/index";
import StateData from "@/views/reactCom/stateData/index";
import ReactEvent from "@/views/reactCom/reactEvent/index";

// 首页模块
const homeRouter: Array<RouteObject> = [
	{
		element: <LayoutIndex />,
		children: [
			{
				path: "/reactCom/reactComponent",
				// element: lazyLoad(React.lazy(() => import("@/views/home/index"))),
				element: <ReactComponent />,
				meta: {
					requiresAuth: true,
					title: "函数组件",
					key: "/reactCom/reactComponent"
				}
			},
			{
				path: "/reactCom/propsData",
				// element: lazyLoad(React.lazy(() => import("@/views/home/index"))),
				element: <PropsData />,
				meta: {
					requiresAuth: true,
					title: "Props 数据传递",
					key: "/reactCom/propsData"
				}
			},
			{
				path: "/reactCom/stateData",
				// element: lazyLoad(React.lazy(() => import("@/views/home/index"))),
				element: <StateData />,
				meta: {
					requiresAuth: true,
					title: "State 状态管理",
					key: "/reactCom/stateData"
				}
			},
			{
				path: "/reactCom/reactEvent",
				// element: lazyLoad(React.lazy(() => import("@/views/home/index"))),
				element: <ReactEvent />,
				meta: {
					requiresAuth: true,
					title: "事件处理",
					key: "/reactCom/reactEvent"
				}
			}
		]
	}
];

export default homeRouter;
